-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Chinese & Cantonese localization #7235
Conversation
I have considered directly using |
Over the past few months, I’ve been trying to understand why compatibility issues with Chinese keep occurring. Maybe this is unlikely to be implemented, but for Chinese, separating Web language code and Native App language code could greatly enhance the experience. With the current code, I can only compromise on Web or Native. Previously I chose to compromise on Native, attempting to make iOS/Android match the Web language codes. Now I try to convert the Web language codes to match Native. |
It looks good to me so far. Then will focus on the continuous improvement of the translation itself. Ready to go. For reference the most suitable Chinese language tags for the platforms: iOS: Android: Web: Lastly, Merry Christmas and a Happy New Year! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay! Thanks so much!
This PR includes the latest translations from Crowdin, and cleans up outdated strings.
Update: We are attempting to convert the language codes for Chinese and Cantonese from RFC-1766 to RFC-4646, to resolve language-related compatibility issues on native.
The following are the changes:
zh-CN
->zh-Hans-CN
zh-TW
->zh-Hant-TW
zh-HK
->zh-Hant-HK
They are lengthy, but both Android and iOS are currently using them. and they are the recommended language code for Chinese by IANA and BCP 47. The tricky issue with Chinese at the moment is that there are two conflicting standards, both of which are widely used.
The compatibility issue on Android stems from the differences in Hermes implementation of
Intl
. On Android, it is based on the ICU4j project, which does not include RFC 1766 Chinese language codes likezh-CN
since Android 7.0. This will be an attempt to fix #6728 without introducing polyfills.Similar to #6774, tests have shown that
zh-Hans-CN
,zh-Hant-TW
andzh-Hant-HK
can also be correctly used by app language.Since these code changes are all related to Chinese adjustments (including modifications to
deviceLocales.ts
), I’ve included them in the regular Chinese localization update PR instead of opening a new one. This also helps our translators test the impact of the changes earlier.The related changes to
deviceLocales.ts
can refer to #6621, except this time the conversion is reversed: from RFC 1766 to RFC 4646, as browsers still widely use RFC 1766. We still need them to correctly match the browser’s default language, and display Chinese when opening the web for the first time.As far as I know, most open-source cross-platform apps that support Chinese have similar mapping mechanisms.I believe this is currently the best approach I’ve come up with for balancing Chinese display across platforms after repeated testing and research.
Note the impact of changing the language code is limited to the app display language, Cantonese still cannot be used as post language.
Co-maintained by @cirx1e @hakadao @VentusUta